package com.joshua.spring.entity.em;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * projectName dragon-cloud
 * package com.joshua.spring.entity.em
 * classname  AuthTypeEnum
 * <p>
 * description
 * </p>
 *
 * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
 * @date 2020/9/18 9:29
 */
@Getter
@AllArgsConstructor
public enum AuthTypeEnum {
    //刷新token
    REFRESH,
    //密码认证
    PASSWORD,
    //邮箱验证码认证
    EMAIL,
    //手机验证码认证
    SMS,
    //微信认证
    THREE_PARTY_WX,
    //二维码认证
    QR_CODE,
    ;

    public static AuthTypeEnum getInstance(String type) {
        for (AuthTypeEnum authTypeEnum : AuthTypeEnum.values()) {
            if (authTypeEnum.toString().equals(type)) {
                return authTypeEnum;
            }
        }
        return PASSWORD;
    }
}
